package com.easa.service;

import com.easa.dao.TeacherMsgDao;
import com.easa.entity.ShowTeacherMsg;
import com.easa.entity.Teachermsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherMsgServiceImpl implements TeacherMsgService{

    @Autowired
    private TeacherMsgDao teacherMsgDao;

    public ShowTeacherMsg findTeacherMsgByid(String tid){
        return teacherMsgDao.findTeacherMsgByid(tid);
    }

    public void setConditionsByTid(String name, String viewClassify, String checkWay, String semesterId, String weekid){
        teacherMsgDao.setConditionsByTid(name,viewClassify,checkWay,semesterId,weekid);
    }

    public int insertTeacherMsg(Teachermsg teachermsg){
        return teacherMsgDao.insertTeacherMsg(teachermsg);
    }

    public int loginValidate(String userId, String password){
        return teacherMsgDao.loginValidate(userId,password);
    }

    public Boolean updateTeacherMsg(Teachermsg teachermsg){
        return teacherMsgDao.updateTeacherMsg(teachermsg);
    }

    public int validateAdmin(String userId, String pass){
        return teacherMsgDao.validateAdmin(userId,pass);
    }

    public List<Teachermsg> searchTeacherMsg(String tname){
        return teacherMsgDao.searchTeacherMsg(tname);
    }

    public int addTeacherMsg(Teachermsg teachermsg){
        return teacherMsgDao.addTeacherMsg(teachermsg);
    }

    public Teachermsg findTeacherDetailByAdmin(String tid){
        return teacherMsgDao.findTeacherDetailByAdmin(tid);
    }

    public int updateTeacherMsgBySAdmin(Teachermsg teachermsg){
        return teacherMsgDao.updateTeacherMsgBySAdmin(teachermsg);
    }

    public int updateTeacherMsgByAdmin(Teachermsg teachermsg){
        return teacherMsgDao.updateTeacherMsgByAdmin(teachermsg);
    }

    public boolean resetPassword(String tid){
        return teacherMsgDao.resetPassword(tid);
    }

    public int modifyPassword(String tid, String newPassword){
        return teacherMsgDao.modifyPassword(tid,newPassword);
    }
}
